var index=0;
var weixin=document.querySelectorAll(".weixin");
var hwx=document.querySelectorAll(".hwx");
var bxslider=document.querySelector(".bxslider");
var circle=document.querySelectorAll(".bx-pager-link");
var is_run=true;
//显示微信二维码



setInterval(function(){
	if(is_run){
		if(index==0){//当下标为第一个时清除，上一个的z-index
			bxslider.children[bxslider.childElementCount-1].setAttribute("style","z-index: 0;opacity: 0;");
		}else{
			bxslider.children[index-1].setAttribute("style","z-index: 0;opacity: 0;");
		}
		bxslider.children[index].setAttribute("style","z-index: 50;opacity: 1;");
		lunbo(index);
		index++;
		if(index==bxslider.childElementCount){
			index=0;
		}
	}
	is_run=true;
},4500)


function lunbo(index){
	for(var i=0;i<bxslider.childElementCount;i++){
		circle[i].classList.remove("active");
	}
	circle[index].classList.add("active");
}

//轮播圆点点击
for(let i=0;i<circle.length;i++){
	circle[i].addEventListener("click",function(){
		bxslider.children[index].setAttribute("style","z-index: 0;opacity: 0;");
		bxslider.children[i].setAttribute("style","z-index:50;opacity: 1;");
		lunbo(i);
		index=i;
		is_run=false;
	})
}	